package apps.reading.spider;

import java.util.ArrayList;
import java.util.List;

import org.htmlparser.Node;

import apps.reading.db.WebSourceBean;
import core.tool.htmlparser.HtmlparserUtil;

public abstract class BaseReading {
	
	public List<WebSourceBean> getWebSourceTitleList(String url,String tabName,String attributeName,String attributeValue) {
		List<WebSourceBean> webSourceList=new ArrayList<WebSourceBean>();
        Node[] nodes = HtmlparserUtil.getNodeList(url,tabName,attributeName,attributeValue);
        String line = "";
        for (int i = 0; i < nodes.length; i++) {
            Node node = nodes[i];
  		  	String result=node.toHtml();
            webSourceList.add(getWebSourceBeanOfStr(result,url));
        }		
		return webSourceList;			
	}
	
	 abstract WebSourceBean getWebSourceBeanOfStr(String result,String url);
	
}
